package com.g2room.search.es.op;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.client.Requests;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;

import com.g2room.search.es.engine.EsClient;

public class EsMapping {
	static Map<String, XContentBuilder> builderMap = getMappings();//new HashMap<String, XContentBuilder>();
	static List<String> tns = new ArrayList<String>();
	static {
//		tns.add("nceeArti");
//		tns.add("univInfo");
//		tns.add("univMajor");
//		tns.add("togImages");
//		tns.add("univEnroNew");
//		tns.add("dicType");
//		tns.add("togForum");
//		tns.add("togCategory");
//		tns.add("univImage");
//		tns.add("univProvScore");
//		tns.add("majorRank");
//		tns.add("univJudgement");
//		tns.add("univKeyMajor");
//		tns.add("sysArea");
//		tns.add("sysAd");
//		tns.add("provScore");
//		tns.add("univRank");
		tns.add("majorInfo");
//		tns.add("univArtiSet");
//		tns.add("univEnrollment");
//		tns.add("univMajorScore");
//		tns.add("togPost");
//		tns.add("sysLink");
//		tns.add("togUser");
//		tns.add("univTeacher");
//		tns.add("univImageCover");
	}
	public static void main(String[] args) {
		String idx = "test";
		initMappingByCreate(idx);
//		idx = "myuall1";
//		initMappingByCreate(idx);
//		idx = "myuall2";
//		initMappingByCreate(idx);
//		initMapping(idx, "univImageCover");
	}
	
	public static void initMapping(String index, String type) {
    	EsClient ec = new  EsClient();
    	ec.init();
    	
		XContentBuilder mapping = builderMap.get(type);
		PutMappingRequest mappingRequest = Requests.putMappingRequest(index).type(type).source(mapping);
		ec.getClient().admin().indices().putMapping(mappingRequest).actionGet();
    }
    
    public static void initMappingByCreate(String index) {
    	EsClient ec = new  EsClient(index);
    	ec.init();
   	 	CreateIndexRequestBuilder cib = ec.getClient().admin().indices().prepareCreate(index);
   	 	for(String type : tns) {
	   	 	XContentBuilder mapping = builderMap.get(type);
	   	 	if(null == mapping) {
	   	 		continue;
	   	 	}
	   	 	cib.addMapping(type, mapping);
   	 	}
   	 	
   	 	cib.execute().actionGet();
    }
    
    public static Map<String, XContentBuilder> getMappings() {
    	if(null == builderMap) builderMap = new HashMap<String, XContentBuilder>();
    	try {
    		builderMap.put("nceeArti", XContentFactory.jsonBuilder().startObject().startObject("nceeArti").startObject("properties").startObject("sourceUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("state").field("type", "integer").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("typeId").field("type", "integer").endObject().startObject("typeCode").field("type", "string").field("index","not_analyzed").endObject().startObject("id").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("publishTime").field("format","yyy-MM-dd||epoch_millis").field("type", "date").endObject().startObject("categoryName").field("type", "string").field("index","not_analyzed").endObject().startObject("updateTime").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("source").field("type", "string").field("index","not_analyzed").endObject().startObject("typeName").field("type", "string").field("index","not_analyzed").endObject().startObject("createTime").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("hot").field("type", "integer").endObject().startObject("categoryCode").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("univInfo", XContentFactory.jsonBuilder().startObject().startObject("univInfo").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("belong").field("type", "string").field("index","not_analyzed").endObject().startObject("study").field("type", "float").endObject().startObject("featureMajor").field("type", "string").field("index","not_analyzed").endObject().startObject("recruitEmail").field("type", "string").field("index","not_analyzed").endObject().startObject("keySubject").field("type", "string").field("index","not_analyzed").endObject().startObject("recruit").field("type", "string").field("index","not_analyzed").endObject().startObject("level").field("type", "integer").endObject().startObject("createDate").field("type", "string").field("index","not_analyzed").endObject().startObject("schoolnature").field("type", "integer").endObject().startObject("description").field("type", "string").field("index","not_analyzed").endObject().startObject("tuition").field("type", "string").field("index","not_analyzed").endObject().startObject("work").field("type", "float").endObject().startObject("propertyId").field("type", "integer").endObject().startObject("nameEn").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("univUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("attr").field("type", "string").field("index","not_analyzed").endObject().startObject("oldname").field("type", "string").field("index","not_analyzed").endObject().startObject("tuitionDetail").field("type", "string").field("index","not_analyzed").endObject().startObject("f211").field("type", "integer").endObject().startObject("doctoralProgram").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("isProvkey").field("type", "integer").endObject().startObject("forumId").field("type", "integer").endObject().startObject("autonomyrs").field("type", "string").field("index","not_analyzed").endObject().startObject("images").field("type", "string").field("index","not_analyzed").endObject().startObject("academician").field("type", "string").field("index","not_analyzed").endObject().startObject("schoolCode").field("type", "string").field("index","not_analyzed").endObject().startObject("ranking").field("type", "integer").endObject().startObject("isArt").field("type", "integer").endObject().startObject("position").field("type", "string").field("index","not_analyzed").endObject().startObject("membership").field("type", "string").field("index","not_analyzed").endObject().startObject("id").field("type", "integer").endObject().startObject("createtime").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("recruitUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("life").field("type", "float").endObject().startObject("f985").field("type", "integer").endObject().startObject("rankingCollegetype").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("students").field("type", "string").field("index","not_analyzed").endObject().startObject("schooltypeId").field("type", "integer").endObject().startObject("propertyName").field("type", "string").field("index","not_analyzed").endObject().startObject("male").field("type", "string").field("index","not_analyzed").endObject().startObject("recruitPhone").field("type", "string").field("index","not_analyzed").endObject().startObject("photo").field("type", "string").field("index","not_analyzed").endObject().startObject("master").field("type", "string").field("index","not_analyzed").endObject().startObject("personNum").field("type", "string").field("index","not_analyzed").endObject().startObject("female").field("type", "string").field("index","not_analyzed").endObject().startObject("address").field("type", "string").field("index","not_analyzed").endObject().startObject("library").field("type", "string").field("index","not_analyzed").endObject().startObject("oldSchoolId").field("type", "integer").endObject().startObject("edudirectly").field("type", "integer").endObject().startObject("isExcellent").field("type", "integer").endObject().startObject("schooltypeName").field("type", "string").field("index","not_analyzed").endObject().startObject("isSingle").field("type", "integer").endObject().startObject("badge").field("type", "string").field("index","not_analyzed").endObject().startObject("majors").field("type", "string").field("index","not_analyzed").endObject().startObject("shoufei").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("univMajor", XContentFactory.jsonBuilder().startObject().startObject("univMajor").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("majorId").field("type", "integer").endObject().startObject("description").field("type", "string").field("index","not_analyzed").endObject().startObject("oldSchoolId").field("type", "integer").endObject().startObject("majorName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("togImages", XContentFactory.jsonBuilder().startObject().startObject("togImages").startObject("properties").startObject("position").field("type", "string").field("index","not_analyzed").endObject().startObject("cityName").field("type", "string").field("index","not_analyzed").endObject().startObject("updatetime").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("status").field("type", "integer").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("authorUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("forumName").field("type", "string").field("index","not_analyzed").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().startObject("cityId").field("type", "integer").endObject().startObject("message").field("type", "string").field("index","not_analyzed").endObject().startObject("id").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("imageUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("forumId").field("type", "integer").endObject().startObject("catname").field("type", "string").field("index","not_analyzed").endObject().startObject("authorName").field("type", "string").field("index","not_analyzed").endObject().startObject("authorId").field("type", "integer").endObject().startObject("synctime").field("type", "string").field("index","not_analyzed").endObject().startObject("catid").field("type", "integer").endObject().startObject("tid").field("type", "integer").endObject().startObject("forumUrl").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("univEnroNew", XContentFactory.jsonBuilder().startObject().startObject("univEnroNew").startObject("properties").startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("oldSchoolId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("type").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("dicType", XContentFactory.jsonBuilder().startObject().startObject("dicType").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("type").field("type", "integer").endObject().startObject("parentId").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().endObject().endObject().endObject());
    		builderMap.put("togForum", XContentFactory.jsonBuilder().startObject().startObject("togForum").startObject("properties").startObject("cityId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("cityName").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("dbUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("description").field("type", "string").field("index","not_analyzed").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("synctime").field("type", "string").field("index","not_analyzed").endObject().startObject("isenable").field("type", "integer").endObject().startObject("dbUsername").field("type", "string").field("index","not_analyzed").endObject().startObject("dbPwd").field("type", "string").field("index","not_analyzed").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("togCategory", XContentFactory.jsonBuilder().startObject().startObject("togCategory").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("icon").field("type", "string").field("index","not_analyzed").endObject().startObject("type").field("type", "integer").endObject().startObject("status").field("type", "integer").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().startObject("displayOrder").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().endObject().endObject().endObject());
    		builderMap.put("univImage", XContentFactory.jsonBuilder().startObject().startObject("univImage").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("sid").field("type", "integer").endObject().startObject("categoryName").field("type", "string").field("index","not_analyzed").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("oldSchoolId").field("type", "integer").endObject().startObject("typeName").field("type", "string").field("index","not_analyzed").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("typeId").field("type", "integer").endObject().startObject("schoolId").field("type", "integer").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("univProvScore", XContentFactory.jsonBuilder().startObject().startObject("univProvScore").startObject("properties").startObject("min").field("type", "integer").endObject().startObject("max").field("type", "string").field("index","not_analyzed").endObject().startObject("varScore").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("var").field("type", "integer").endObject().startObject("score").field("type", "integer").endObject().startObject("fencha").field("type", "integer").endObject().startObject("schoolId").field("type", "integer").endObject().startObject("batchId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("num").field("type", "integer").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("batchName").field("type", "string").field("index","not_analyzed").endObject().startObject("year").field("type", "integer").endObject().startObject("studentType").field("type", "integer").endObject().startObject("oldSchoolid").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("majorRank", XContentFactory.jsonBuilder().startObject().startObject("majorRank").startObject("properties").startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("id").field("type", "integer").endObject().startObject("level").field("type", "integer").endObject().startObject("majorId").field("type", "integer").endObject().startObject("mainSubjects").field("type", "string").field("index","not_analyzed").endObject().startObject("code").field("type", "string").field("index","not_analyzed").endObject().startObject("majorName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("type").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("univJudgement", XContentFactory.jsonBuilder().startObject().startObject("univJudgement").startObject("properties").startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("id").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("nickname").field("type", "string").field("index","not_analyzed").endObject().startObject("oldSchoolId").field("type", "integer").endObject().startObject("head").field("type", "string").field("index","not_analyzed").endObject().startObject("judgeTime").field("type", "string").field("index","not_analyzed").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("univKeyMajor", XContentFactory.jsonBuilder().startObject().startObject("univKeyMajor").startObject("properties").startObject("oldSchoolId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("majorName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("type").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("sysArea", XContentFactory.jsonBuilder().startObject().startObject("sysArea").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("sortWord").field("type", "string").field("index","not_analyzed").endObject().startObject("pid").field("type", "integer").endObject().startObject("isrecommend").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().endObject().endObject().endObject());
    		builderMap.put("sysAd", XContentFactory.jsonBuilder().startObject().startObject("sysAd").startObject("properties").startObject("cityId").field("type", "integer").endObject().startObject("position").field("type", "string").field("index","not_analyzed").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("id").field("type", "integer").endObject().startObject("cityName").field("type", "string").field("index","not_analyzed").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("updatetime").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("status").field("type", "integer").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("imageUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("type").field("type", "integer").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("provScore", XContentFactory.jsonBuilder().startObject().startObject("provScore").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("batchId").field("type", "integer").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("batchName").field("type", "string").field("index","not_analyzed").endObject().startObject("score").field("type", "integer").endObject().startObject("year").field("type", "integer").endObject().startObject("type").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("univRank", XContentFactory.jsonBuilder().startObject().startObject("univRank").startObject("properties").startObject("propertyId").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("propertyName").field("type", "string").field("index","not_analyzed").endObject().startObject("rankProvName").field("type", "string").field("index","not_analyzed").endObject().startObject("matriculation").field("type", "integer").endObject().startObject("type").field("type", "integer").endObject().startObject("schoolId").field("type", "integer").endObject().startObject("rankProv").field("type", "integer").endObject().startObject("jobLevel").field("type", "string").field("index","not_analyzed").endObject().startObject("id").field("type", "integer").endObject().startObject("batchId").field("type", "integer").endObject().startObject("rank").field("type", "integer").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("batchName").field("type", "string").field("index","not_analyzed").endObject().startObject("oldSchoolId").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("majorInfo", XContentFactory.jsonBuilder().startObject().startObject("majorInfo").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("rankingtype").field("type", "integer").endObject().startObject("detail").field("type", "string").field("index","not_analyzed").endObject().startObject("specialurl").field("type", "string").field("index","not_analyzed").endObject().startObject("level").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("typeName").field("type", "string").field("index","not_analyzed").endObject().startObject("code").field("type", "string").field("index","not_analyzed").endObject().startObject("ranking").field("type", "integer").endObject().startObject("znum").field("type", "string").field("index","not_analyzed").endObject().startObject("typeId").field("type", "integer").endObject().startObject("bnum").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("univArtiSet", XContentFactory.jsonBuilder().startObject().startObject("univArtiSet").startObject("properties").startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("id").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("univEnrollment", XContentFactory.jsonBuilder().startObject().startObject("univEnrollment").startObject("properties").startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("id").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("publishTime").field("format","yyy-MM-dd||epoch_millis").field("type", "date").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("createTime").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("oldSchoolId").field("type", "integer").endObject().startObject("sourceurl").field("type", "string").field("index","not_analyzed").endObject().startObject("type").field("type", "integer").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("univMajorScore", XContentFactory.jsonBuilder().startObject().startObject("univMajorScore").startObject("properties").startObject("min").field("type", "integer").endObject().startObject("max").field("type", "string").field("index","not_analyzed").endObject().startObject("varScore").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("var").field("type", "integer").endObject().startObject("schoolId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("batchId").field("type", "integer").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("majorId").field("type", "integer").endObject().startObject("batchName").field("type", "string").field("index","not_analyzed").endObject().startObject("oldSchoolId").field("type", "integer").endObject().startObject("year").field("type", "integer").endObject().startObject("majorName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("studentType").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("togPost", XContentFactory.jsonBuilder().startObject().startObject("togPost").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("fid").field("type", "integer").endObject().startObject("cityName").field("type", "string").field("index","not_analyzed").endObject().startObject("stick").field("type", "integer").endObject().startObject("authorUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("forumName").field("type", "string").field("index","not_analyzed").endObject().startObject("digest").field("type", "integer").endObject().startObject("dateline").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("highlight").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("cityId").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("authorName").field("type", "string").field("index","not_analyzed").endObject().startObject("synctime").field("type", "string").field("index","not_analyzed").endObject().startObject("authorId").field("type", "integer").endObject().startObject("tid").field("type", "integer").endObject().startObject("oldStatus").field("type", "integer").endObject().startObject("forumUrl").field("type", "string").field("index","not_analyzed").endObject().startObject("status").field("type", "integer").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("categoryName").field("type", "string").field("index","not_analyzed").endObject().startObject("views").field("type", "integer").endObject().startObject("replies").field("type", "integer").endObject().startObject("forumId").field("type", "integer").endObject().startObject("showSummary").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("sysLink", XContentFactory.jsonBuilder().startObject().startObject("sysLink").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("logo").field("type", "string").field("index","not_analyzed").endObject().startObject("description").field("type", "string").field("index","not_analyzed").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().endObject().endObject().endObject());
    		builderMap.put("togUser", XContentFactory.jsonBuilder().startObject().startObject("togUser").startObject("properties").startObject("cityId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("cityName").field("type", "string").field("index","not_analyzed").endObject().startObject("username").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceName").field("type", "string").field("index","not_analyzed").endObject().startObject("email").field("type", "string").field("index","not_analyzed").endObject().startObject("status").field("type", "integer").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("regTime").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("type", "date").endObject().startObject("regIp").field("type", "string").field("index","not_analyzed").endObject().startObject("password").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
    		builderMap.put("univTeacher", XContentFactory.jsonBuilder().startObject().startObject("univTeacher").startObject("properties").startObject("oldSchoolId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("faculties").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("teacherName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
    		builderMap.put("univImageCover", XContentFactory.jsonBuilder().startObject().startObject("univImageCover").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik").endObject().startObject("url").field("type", "string").field("index","not_analyzed").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
		} catch(Exception e) {
			e.printStackTrace();
		}
    	return builderMap;
    }
}
